Creating new array with updating array element without mutating the original array

visit shbcf.ru